package com.usian.controller;

import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.user.dtos.AuthDto;
import com.usian.service.ApUserRealnameService;
import com.usian.user.ApUserRealnameControllerApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/auth")
public class ApUserRealnameController implements ApUserRealnameControllerApi {


    @Autowired
    private ApUserRealnameService apUserRealnameService;


    /**
     * 认证用户列表分页查询
     *
     * @param dto
     * @return
     */
    @Override
    @PostMapping("/list")
    public ResponseResult findApUserRealname(@RequestBody  AuthDto dto) {
        return apUserRealnameService.findApUserRealname(dto);
    }

    @Override
    @PostMapping("/authPass")
    public ResponseResult pass(@RequestBody AuthDto dto) {
        return apUserRealnameService.updateStatus(dto);
    }

    @Override
    @PostMapping("/authFail")
    public ResponseResult fail(@RequestBody AuthDto dto) {
        return apUserRealnameService.updateStatus(dto);
    }
}
